package com.financing.wap.web.controller.api;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.financing.wap.common.ResultMap;
import com.financing.wap.common.ResultMap.STATUS;
import com.financing.wap.service.IActivitesGroupNameService;
import com.financing.wap.web.controller.BaseController;

/**
 * 获取随机活动组名
 * @author ios
 *
 */
@Controller("activitiesGroupNameController")
@RequestMapping("/api/activitiesGroupName")
public class ActivitiesGroupNameController extends BaseController {
	Logger logger = Logger.getLogger(getClass());

	@Autowired
	private IActivitesGroupNameService activitiesGroupNameService;
	
	@RequestMapping("/get")
	@ResponseBody
	public ResultMap wx(HttpServletRequest request, HttpServletResponse response){
		ResultMap result = new ResultMap();
		
		try{
			result.setAttribute("groupName",activitiesGroupNameService.getGrpupName());
		}catch(Exception e){
			log.error("get activities group name error ",e);
			result.setStatus(STATUS.ERROR);
			result.setStatusCode(ResultMap.STATUS_CODE_SYS_EXCEPTION);
		}
		
		result.setStatusCode(ResultMap.STATUS_CODE_SUCCESS);
		result.setStatus(ResultMap.STATUS.SUCCESS);
		return result;
	}

}
